<%--
    登录
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <style>
        body {
            display: flex;
            justify-content: space-between; /* 左侧为方框，右侧为登录框 */
            align-items: center;  /* 垂直居中 */
            height: 100vh;
            margin: 0;
            font-family: Arial, sans-serif;
            background-color: #f5f5f5;
        }

        body {
            display: flex; /* 使用 flexbox 布局 */
            justify-content: space-around; /* 水平排列，图片和登录框之间留出空隙 */
            align-items: center; /* 垂直居中 */
            height: 100vh; /* 页面高度填满视口 */
            margin: 0;
            background-color: #f5f5f5; /* 背景色 */
        }

        /* 登录框样式 */
        .login-container {
            width: 35%; /* 登录框占页面宽度的 25% */
            max-width: 400px; /* 限制登录框的最大宽度 */
            padding: 20px;
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            text-align: center;
        }

        .form-group {
            margin-bottom: 15px;
            text-align: left;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }

        .form-group input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }

        .login-button {
            width: 100%;
            padding: 10px;
            background-color: #4CAF50;
            color: #fff;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            cursor: pointer;
        }

        .login-button:hover {
            background-color: #45a049;
        }

        /* 底栏样式 */
        .footer {
            width: 100%;
            padding: 10px 0;
            background-color: #fff;
            text-align: center;
            border-top: 1px solid #ddd;
            position: absolute;
            bottom: 0;
            left: 0;
        }

        .footer a {
            color: #4CAF50;
            text-decoration: none;
            margin: 0 15px;
            font-size: 14px;
        }

        .footer a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>

<!-- 登录框容器 -->
<div class="login-container">
    <h2>登录</h2>
    <form action="./loginServlet" method="post">
        <div class="form-group">
            <label for="username">用户名</label>
            <input type="text" id="username" name="username" required>
        </div>
        <div class="form-group">
            <label for="password">密码</label>
            <input type="password" id="password" name="password" required>
        </div>
        <button type="submit" class="login-button">登录</button>
    </form>
    <form>
        <button type="button" class="login-button" onclick="window.location.href='reg.jsp'">注册</button>
    </form>
</div>

<!-- 底栏 -->
<div class="footer">
    <a href="#" onclick="window.location.href='managerLogin.jsp'">
        管理员
    </a> |
    <a href="#">
        关于我们
    </a>
</div>
</body>
</html>
